home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / THINK C Digest / 1991 / 91-03 < prev    next >
Text File  |  1995-12-31  |  79KB  |  2,102 lines

  1. 
  2. Path: ucivax!gateway
  3. From: dmac@eagle.mit.edu ("David S. McCormick")
  4. Subject: Stack smashing the heap in TCL
  5. Message-ID: <9103022228.AA00797@EAGLE.MIT.EDU>
  6. Newsgroups: fa.think-c
  7. Lines: 44
  8. Date: 2 Mar 91 22:32:07 GMT
  9.  
  10. I am using a dialog subclass of window which accesses STR# and TEXT/styl
  11. resources to create a help window. I am using a  subclass of StaticText
  12. which handles TEXT/styl resources in a ScrollPane. The STR# is read in
  13. just fine.
  14.  
  15. For the Dialog
  16. itsGopher = this;
  17. so that I can intercept KeyDown's to give the list pane KeyDowns and
  18. subsequently change to a new TEXT/styl resource.
  19. I load these resources depending what item in a scrolling list are
  20. clicked on. I load them with
  21.  
  22. void    CMyHelpDialog::DoListClick ()
  23. {
  24. CharsHandle        theAboutText;
  25. StScrpHandle    theAboutStyle;
  26.  
  27. ...
  28. theTextH = GetResource( 'TEXT', theID);
  29. theStyleH = GetResource( 'styl', theID);
  30. ...
  31. /* put the TEXT/styl in the Panorama */
  32. ...
  33. ReleaseResource ((Handle) theTextH);
  34. ReleaseResource ((Handle) theStyleH);
  35. ...
  36. }
  37.  
  38. Anyhow, I intercept the keydowns fine and switch the position in the
  39. list, then load a new TEXT/styl resource to correspond to this change.
  40. After a couple of keydowns, the Mac freezes and when I poke around in
  41. TMON I get the infamous Deep Shit Errors 25 and 28 which means that the
  42. Stack has grown over the Heap and smashed the Heap.
  43. THIS PROBLEM ONLY OCCURS WHEN I BUILD THE APPLICATION; IT WORKS FINE
  44. WHEN IN THE DEBUGGER.
  45.  
  46. Can anyone give me any clues as to why the stack is suddenly getting so
  47. big?
  48.  
  49. Many thanks.
  50. Cheers,
  51. David S. McCormick
  52. MIT-EAPS Geology
  53. dmac@eagle.mit.edu
  54. 
  55. 
  56. Path: ucivax!gateway
  57. From: dmac@eagle.mit.edu ("David S. McCormick")
  58. Subject: Stack smashing the heap in TCL
  59. Message-ID: <9103022233.AA00824@EAGLE.MIT.EDU>
  60. Newsgroups: fa.think-c
  61. Lines: 44
  62. Date: 2 Mar 91 22:37:22 GMT
  63.  
  64. I am using a dialog subclass of window which accesses STR# and TEXT/styl
  65. resources to create a help window. I am using a  subclass of StaticText
  66. which handles TEXT/styl resources in a ScrollPane. The STR# is read in
  67. just fine.
  68.  
  69. For the Dialog
  70. itsGopher = this;
  71. so that I can intercept KeyDown's to give the list pane KeyDowns and
  72. subsequently change to a new TEXT/styl resource.
  73. I load these resources depending what item in a scrolling list are
  74. clicked on. I load them with
  75.  
  76. void    CMyHelpDialog::DoListClick ()
  77. {
  78. CharsHandle        theAboutText;
  79. StScrpHandle    theAboutStyle;
  80.  
  81. ...
  82. theTextH = GetResource( 'TEXT', theID);
  83. theStyleH = GetResource( 'styl', theID);
  84. ...
  85. /* put the TEXT/styl in the Panorama */
  86. ...
  87. ReleaseResource ((Handle) theTextH);
  88. ReleaseResource ((Handle) theStyleH);
  89. ...
  90. }
  91.  
  92. Anyhow, I intercept the keydowns fine and switch the position in the
  93. list, then load a new TEXT/styl resource to correspond to this change.
  94. After a couple of keydowns, the Mac freezes and when I poke around in
  95. TMON I get the infamous Deep Shit Errors 25 and 28 which means that the
  96. Stack has grown over the Heap and smashed the Heap.
  97. THIS PROBLEM ONLY OCCURS WHEN I BUILD THE APPLICATION; IT WORKS FINE
  98. WHEN IN THE DEBUGGER.
  99.  
  100. Can anyone give me any clues as to why the stack is suddenly getting so
  101. big?
  102.  
  103. Many thanks.
  104. Cheers,
  105. David S. McCormick
  106. MIT-EAPS Geology
  107. dmac@eagle.mit.edu
  108. 
  109. 
  110. Path: ucivax!gateway
  111. From: ehorvath@attmail.COM
  112. Subject: Re: class declarations
  113. Original-From: attmail!ehorvath (Ned Horvath )
  114. Lines: 82
  115. Date: 4 Mar 91 01:52:40 GMT
  116. Phone: +1 908 671 7100
  117. Message-ID: <9103031750.aa14781@ICS.UCI.EDU>
  118. In-Reply-To: your message <internet0590007030> of Wed Feb 27 21:26:10 GMT 1991
  119. >To: internet!ics.uci.edu!think-c
  120. Content-Type: text
  121. Content-Length: 3338
  122. Newsgroups: fa.think-c
  123. Message-Version: 2
  124. EMail-Version: 2
  125. UA-Message-ID: <MAC-1.3.2-618034-ehorvath-254>
  126. UA-Content-ID: <MAC-1.3.2-618034-ehorvath-254>
  127. MTS-Message-ID: <ehorvath0630027101>
  128.  
  129. Garth Dickie writes,
  130. > I am writing a class library for TC4; I want to experiment with some stuff
  131. > which doesn't fit into the TCL.  This question has to do with the way I
  132. > create objects from resource templates.
  133.  
  134. >The idea is to correlate an integer with every class which may be
  135. > instantiated from a template.  Then that integer is translated at runtime
  136. > into a void*, which can be passed to new to get an object of the appropriate
  137. > type.  What I *don't* want to do is a switch with one line per class, or
  138. > similar kludery.
  139. ...
  140.  
  141. If Garth's the only person interested in this kind of elegant hack, please
  142. forgive posting to the list.  But I suspect there's more than one person out
  143. there who's interested...
  144.  
  145. The following file compiles clean for me (I copied it directly from the ThC
  146. source window, so I KNOW it's clean):
  147.  
  148. ------- Cut here ----------
  149. #define ctabEntry(name,restype)        { #name, restype, name }
  150.  
  151. typedef struct classTab {
  152.     char *        className;
  153.     ResType        classResType;
  154.     void *        classSpec;
  155. } classTab;
  156.  
  157.  
  158. #include <CPanorama.h>
  159. #include <CPane.h>
  160. #include <CBureaucrat.h>
  161.  
  162. classTab myTab[] = {
  163.     ctabEntry (CPane, 'Pane'),
  164.     ctabEntry (CBureaucrat, 'Buro'),
  165.     ctabEntry (CPanorama, 'Pano'),
  166.     {0,0,0}
  167. };
  168. ------- End Cut ------------
  169.  
  170. A bit of explanation.  The ctabEntry macro exploits an ANSI-ism, namely
  171.         #param becomes "paramvalue"
  172. when the macro is expanded.  This lets you type each class name once, and the
  173. string constant is guaranteed to match the type name.  This is a nice
  174. typecheck: to see that ThC will catch an error, try adding
  175.         ctabEntry (CBogus, 'hah!'),
  176. to the myTab definition.
  177.  
  178. Anyway: each classTab entry contains the name of the class as a string
  179. constant; the resource type you want to associate with the class; and the
  180. void* that bless(obj,classtype) wants for its second argument.
  181.  
  182. An aside: please excuse the use of CBureaucrat; that's an abstract class that
  183. you'll never instantiate, let alone save as a resource, but you could if you
  184. wanted to...
  185.  
  186. This table now admits of lookup based on any of several criteria; I'm tempted
  187. to expand it into a full-blown class definition myself.  Some of the
  188. operations you might perform with a table like this are
  189.         - look up the resource type associated with a given class by name.
  190.         - look up resource type given class by void*.
  191.         - look up resource type given an instance of the class.
  192.         - look up class type given a resource type.
  193.         - look up class type given a resource.
  194.         - a replacement for LoadResource, but returning a blessed object.
  195.         - a replacement for CreateResource, but taking an object as argument.
  196.  
  197. One of the objections Garth raises to this approach is that the classTab has
  198. to be recompiled whenever any of the class interface headers changes.  That's
  199. perfectly true, but personally, I couldn't care less: it's a small price to
  200. pay, and ThC will take care of it for me.  Notice that the rest of what he was
  201. after -- only one source file to maintain, and the linker does most of the
  202. work -- are satisfied by this approach.  You still need to write the lookup
  203. procedures.
  204.  
  205. Is that the kind of thing you had in mind, or have I missed your intent
  206. entirely?  Anyway it was fun to think about, so thanks for the stimulation...
  207.  
  208. =Ned Horvath=
  209. ehorvath@attmail.com
  210. ehorvath@applelink.apple.com
  211. 
  212. 
  213. Path: ucivax!gateway
  214. From: dmac@eagle.mit.edu ("David S. McCormick")
  215. Subject: Re: Stack smashing the heap in TCL
  216. Message-ID: <9103041333.AA05483@EAGLE.MIT.EDU>
  217. Newsgroups: fa.think-c
  218. Lines: 9
  219. Date: 4 Mar 91 13:35:16 GMT
  220.  
  221. As ephaim@think.com pointed out, I did not indicate which machine I was
  222. running on when all the excitement occurred. I am using an SE/30 running
  223. sys 6.0.7 with 8 mb RAM under Multifinder with the default application
  224. memory size of 384k.
  225.  
  226. Thanks,
  227. David S. McCormick
  228. MIT-EAPS Geology
  229. dmac@eagle.mit.edu
  230. 
  231. 
  232. Path: ucivax!gateway
  233. From: dmac@eagle.mit.edu ("David S. McCormick")
  234. Subject: Where to intercept clicks to allow different panes to communicate within same window?
  235. Message-ID: <9103041954.AA12274@EAGLE.MIT.EDU>
  236. Newsgroups: fa.think-c
  237. Lines: 18
  238. Date: 4 Mar 91 19:57:03 GMT
  239.  
  240. I have a window which contains several panes which need to communicate.
  241. I have a scrolling list pane and a static text in a scroll pane to
  242. display some TEXT resources. When the list is clicked on, a particular
  243. TEXT resource is loaded into theTextPane. I have gotten this to work by
  244. having a list method SetCmdClick() which is the same that for CButton,
  245. so that when the DoClick() method is invoked for the list, itsSupervisor
  246. gets a DoCommand() message afterward. Is there a more
  247. politically-correct TCL way to do this? It's easy to override the
  248. DoKeyDown() method for a Document or Director to dispatch KeyDown's, but
  249. the document can's normally dispatch clicks. Should I declare a subclass
  250. of Window to allow it to dispatch clicks?
  251.  
  252. Any help appreciated.
  253.  
  254. Cheers,
  255. David S. McCormick
  256. MIT-EAPS Geology
  257. dmac@eagle.mit.edu
  258. 
  259. 
  260. Path: ucivax!gateway
  261. From: jbr@cblph.att.COM
  262. Subject: Sharing Classes Between Projects
  263. Message-ID: <9103050613.aa04479@ICS.UCI.EDU>
  264. Newsgroups: fa.think-c
  265. Original-From: j.a.brownlee
  266. Lines: 32
  267. Date: 5 Mar 91 14:16:07 GMT
  268.  
  269. I have some classes that I would like to share between several projects.  The
  270. classes aren't generally useful for any type of project -- they are only useful
  271. across a suite of applications I am developing.
  272.  
  273. Sharing the .c files is easy, but I am having trouble coming up with a good
  274. way to share the .h files.  I would like a method that does not require a
  275. complete re-work if I move the entire directory structure to a new location.
  276.  
  277. Here is what I have thought of:
  278.  
  279.    .    Put the stuff in the THINK C tree.  I would like to avoid this if
  280.     possible, but this is probably my fall back solution.
  281.  
  282.    .    Use some sort of relative pathname in the #include statements, like
  283.     using "../file.h" under UNIX.  Is there a way to do this?
  284.  
  285.    .    Use a #define in each project to define the desired include directory,
  286.     then use statements like:
  287.  
  288.         #include MY_INCLUDE_DIR ## "file.h"
  289.  
  290.     (does this even work?)  This is crummy because if I move the include
  291.     directory, I have to edit a file in every project.
  292.  
  293. I'm sure someone out there has run into this problem before, so I am interested
  294. in hearing any solutions you have tried.  E-mail if you like, but I think that
  295. this topic would interest many list subscribers.
  296.  
  297.    -      _   Joe Brownlee, Analysts International Corp. @ AT&T Network Systems
  298.   /_\  @ / `  471 E Broad St, Suite 1610, Columbus, Ohio 43215   (614) 860-7461
  299.  /   \ | \_,  E-mail: jbr@cblph.att.com     Who pays attention to what _I_ say?
  300.  "Scotty, we need warp drive in 3 minutes or we're all dead!" --- James T. Kirk
  301. 
  302. 
  303. Path: ucivax!gateway
  304. From: MCGUFFEY@muvms3.mu.wvnet.edu (Michael McGuffey)
  305. Subject: anyone know where i can find Spinside Macintosh?
  306. Message-ID: <66EDA173A0202B3B@WVNVMS.WVNET.EDU>
  307. Newsgroups: fa.think-c
  308. X-VMS-To: IN%"think-c@ics.uci.edu"
  309. Lines: 20
  310. Date: 5 Mar 91 16:40:22 GMT
  311. X-Envelope-to: think-c@ics.uci.edu
  312.  
  313.  
  314. I've been looking around for the electronic version of the _Inside Macintosh_
  315. series.  It's not on apple.com.  Judging from the ls-lR on ftp.apple.com,
  316. it's there, but not accessible.  I looked on CompuServe but cannot find it.
  317.  
  318. I don't really have access to a CD-Rom at this time or I would subscribe to
  319. D E V E L O P.
  320.  
  321. Anyone have any suggestions?
  322.  
  323. Also, is _Spinside Macintosh_ a replacement for the 5 volume set or is
  324. that set still recommended?
  325.  
  326.  
  327. -----------------------------------------------------------------------------
  328. Michael McGuffey, Director      BITNET:   mcguffey@marshall
  329. Office of Institutional Research  Internet: mcguffey@marshall.wvnet.edu
  330. Marshall University          Phone:    304/696-3212
  331. Huntington, WV 25755          FAX:      304/696-3601
  332. -----------------------------------------------------------------------------
  333. 
  334. 
  335. Path: ucivax!gateway
  336. From: bin@primate.wisc.edu (Brain in Neutral)
  337. Subject: Re: Sharing Classes Between Projects
  338. Message-ID: <9103051637.AA03076@rhesus.primate.wisc.edu>
  339. Newsgroups: fa.think-c
  340. Lines: 53
  341. Date: 5 Mar 91 16:40:51 GMT
  342.  
  343.  
  344. >I have some classes that I would like to share between several projects.  The
  345. >classes aren't generally useful for any type of project -- they are only useful
  346. >across a suite of applications I am developing.
  347.  
  348. >Sharing the .c files is easy, but I am having trouble coming up with a good
  349. >way to share the .h files.  I would like a method that does not require a
  350. >complete re-work if I move the entire directory structure to a new location.
  351.  
  352. Yes, indeed, so would I.  The method that I am aware of (put the .h files
  353. in current or subfolder) is unhelpful.  It leads to duplication of files
  354. in multiple project folders (a bad idea) or ugly pathname dependencies.
  355. The latter is also a problem for .c files included in projects if you happen
  356. to move the project somewhere else.  Suddenly you have to remove and re-add
  357. some files.
  358.  
  359. >Here is what I have thought of:
  360.  
  361. >   .    Put the stuff in the THINK C tree.  I would like to avoid this if
  362. >    possible, but this is probably my fall back solution.
  363.  
  364. This is what I do for header files.  I have a "local #includes" folder
  365. as a counterpart to "mac #includes" in the THINK C folder.  At least that
  366. way it's marked as not part of the standard distribution.
  367.  
  368. But I wish there were some sort of project-specific configuration one
  369. could use to duplicate the UNIX cc -I option...
  370.  
  371. >   .    Use some sort of relative pathname in the #include statements, like
  372. >    using "../file.h" under UNIX.  Is there a way to do this?
  373.  
  374.     Breaks if you move your project folder somewhere else?
  375.  
  376. >   .    Use a #define in each project to define the desired include directory,
  377. >    then use statements like:
  378.  
  379. >        #include MY_INCLUDE_DIR ## "file.h"
  380.  
  381. >    (does this even work?)  This is crummy because if I move the include
  382. >    directory, I have to edit a file in every project.
  383.  
  384. Perhaps if there is a project-specific header file that's #included in
  385. every project file, you could put that line in it.  At least that way,
  386. when you move the project, you only have to edit one line.
  387.  
  388. >I'm sure someone out there has run into this problem before, so I am interested
  389. >in hearing any solutions you have tried.  E-mail if you like, but I think that
  390. >this topic would interest many list subscribers.
  391.  
  392. It would certainly interest me.
  393.  
  394. Paul DuBois
  395. dubois@primate.wisc.edu
  396. 
  397. 
  398. Path: ucivax!gateway
  399. From: rsfinn@quark.lcs.mit.edu ("Russell S. Finn")
  400. Subject: Re: Sharing Classes Between Projects
  401. Message-ID: <9103052031.AA02200@quark.LCS.MIT.EDU>
  402. Newsgroups: fa.think-c
  403. Lines: 65
  404. Date: 5 Mar 91 20:34:30 GMT
  405.  
  406. Paul DuBois writes (quoting Joe Brownlee initially):
  407. > >I have some classes that I would like to share between several projects.  The
  408. > >classes aren't generally useful for any type of project -- they are only useful
  409. > >across a suite of applications I am developing.
  410. >
  411. > >Sharing the .c files is easy, but I am having trouble coming up with a good
  412. > >way to share the .h files.  I would like a method that does not require a
  413. > >complete re-work if I move the entire directory structure to a new location.
  414. >
  415. > Yes, indeed, so would I.  The method that I am aware of (put the .h files
  416. > in current or subfolder) is unhelpful.  It leads to duplication of files
  417. > in multiple project folders (a bad idea) or ugly pathname dependencies.
  418. > The latter is also a problem for .c files included in projects if you happen
  419. > to move the project somewhere else.  Suddenly you have to remove and re-add
  420. > some files.
  421.  
  422. I'm not sure I understand the problem.  If you're working on a related
  423. group of programs, then it doesn't seem unreasonable to place all of
  424. the project files in one folder.  Why isn't the following scheme
  425. satisfactory (indentation represents nesting of folders)?
  426.  
  427. * Suite Folder
  428.     * App1.proj
  429.     * App1.proj.rsrc
  430.     * App1 Source Folder
  431.         * App1-main.c
  432.         * App1-sub1.c
  433.         * ...
  434.     * App1 Include Folder
  435.         * App1-defs.h
  436.         * ...
  437.     * App2.proj
  438.     * App2.proj.rsrc
  439.     * App2 Source Folder
  440.         * App2-main.c
  441.         * App2-sub2.c
  442.         * ...
  443.     * App2 Include Folder
  444.         * App2-defs.h
  445.         * ...
  446.     * Common Source Folder
  447.         * common-subs.c
  448.         * ...
  449.     * Common Include Folder
  450.         * common-defs.h
  451.         * ...
  452.  
  453. If there are naming conflicts between application-specific files
  454. (e.g., two "main.c" files), the "App1" folders could be placed in
  455. a project-specific folder called "(App1.proj)", etc.
  456.  
  457. You need to be careful when creating files, to make sure they go into
  458. the proper folders (a utility like Super Boomerang would be a great
  459. help here), but having done that, you can open your source and include
  460. files directly from the project window, so navigating the hierarchy
  461. shouldn't be a problem.  Since the project files themselves are at the
  462. top level of this hierarchy, all subfolders will be searched for
  463. include files (except, of course, those named with parentheses), so
  464. there shouldn't be any trouble finding them.
  465.  
  466. Now I've just done this off the top of my head, so maybe I've
  467. overlooked something, but is that what you're looking for?
  468.  
  469. -- Russell Finn
  470. rsfinn@lcs.mit.edu
  471. 
  472. 
  473. Path: ucivax!gateway
  474. From: julian@riacs.edu
  475. Subject: Re: Sharing Classes Between Projects
  476. Message-ID: <657.668225766@miranda.riacs.edu>
  477. Newsgroups: fa.think-c
  478. Lines: 4
  479. Date: 6 Mar 91 02:19:40 GMT
  480.  
  481. Seems to me that using THINK C's parenthesis rule would help here.  All
  482. projects would go in a main folder.  Each project's specific files
  483. would go in its parenthesized subfolder.  The common files would go in
  484. non-parenthesized folders.
  485. 
  486. 
  487. Path: ucivax!gateway
  488. From: bin@primate.wisc.edu (Brain in Neutral)
  489. Subject: Re: Sharing Classes Between Projects
  490. Message-ID: <9103060704.AA08978@rhesus.primate.wisc.edu>
  491. Newsgroups: fa.think-c
  492. Lines: 21
  493. Date: 6 Mar 91 07:07:45 GMT
  494.  
  495.  
  496. >I'm not sure I understand the problem.  If you're working on a related
  497. >group of programs, then it doesn't seem unreasonable to place all of
  498. >the project files in one folder.  Why isn't the following scheme
  499. >satisfactory (indentation represents nesting of folders)?
  500.  
  501. >* Suite Folder
  502.     >* App1.proj
  503.     >* App1.proj.rsrc
  504.     >* App1 Source Folder
  505.     > etc.
  506.  
  507. If they're related, yes.  But what if the files to which you want
  508. to refer are general enough or of sufficient importance that you want
  509. to use them in *all* your projects, related or not?
  510.  
  511. E.g., for commonly-included header files, why should I have to care
  512. at all where I put my project, and its folder/subfolders?
  513.  
  514. Paul DuBois
  515. dubois@primate.wisc.edu
  516. 
  517. 
  518. Path: ucivax!gateway
  519. From: minow@bolt.enet.dec.COM ("Martin Minow, ML3-5/U26  06-Mar-1991 1010")
  520. Subject: re: sharing classes
  521. Message-ID: <9103061517.AA25936@decpa.pa.dec.com>
  522. Newsgroups: fa.think-c
  523. Lines: 15
  524. Date: 6 Mar 91 15:21:58 GMT
  525.  
  526. Of course, what we have here is another instance of multiple-inheritance.
  527.  
  528. I just duplicate the files, but, hey, I'm lazy.  I think that System 7's
  529. "alias" capability would let you keep one central source code repository
  530. that is visible in multiple folders.  (This assumes, of course, that
  531. the Think compiler handles aliased files correctly, but I don't think
  532. this is a real problem.)
  533.  
  534. Now, if only I could put my resource source file in the project so
  535. it gets built automatically.
  536.  
  537. And, if only that resource source was in Rez format so constants were
  538. entered once only.
  539.  
  540. Martin.
  541. 
  542. 
  543. Path: ucivax!gateway
  544. From: rsfinn@quark.lcs.mit.edu ("Russell S. Finn")
  545. Subject: Re: Sharing Classes Between Projects
  546. Message-ID: <9103061943.AA02959@quark.LCS.MIT.EDU>
  547. Newsgroups: fa.think-c
  548. Lines: 18
  549. Date: 6 Mar 91 19:46:34 GMT
  550.  
  551. > If they're related, yes.  But what if the files to which you want
  552. > to refer are general enough or of sufficient importance that you want
  553. > to use them in *all* your projects, related or not?
  554.  
  555. OK, in that case, I agree it's best to just put them in a folder in
  556. your THINK C folder.  I thought the original poster said he was
  557. working on a group of related projects, and had files common to those
  558. projects (but not necessarily applicable outside the group), so I made
  559. my suggestion.
  560.  
  561. As Martin Minow points out, the use of aliases in System 7 may help
  562. the situation out as well.  (In fact, I can't help thinking that it's
  563. been over a year and a half since THINK C 4.0 came out (hi, Michael),
  564. and while I don't want to start any rumors, wouldn't a System-7-studly
  565. version of THINK C be something to look forward to?)
  566.  
  567. -- Russ
  568.  
  569. 
  570. 
  571. Path: ucivax!gateway
  572. From: jbr@cblph.att.COM
  573. Subject: Re: Sharing Classes Between Projects
  574. Message-ID: <9103070433.aa26420@ICS.UCI.EDU>
  575. Newsgroups: fa.think-c
  576. Original-From: j.a.brownlee
  577. Lines: 10
  578. Date: 7 Mar 91 12:34:48 GMT
  579.  
  580. Thanks one and all for your comments.  I am going to use the "sub-folder"
  581. method, which seems to meet my needs.  However, as one poster pointed out,
  582. THINK C really needs a dialog something like "cc -I" to specify include
  583. directories.  And while you're at it, how about a "cc -D"-like option to
  584. define global pre-processor symbols, too?
  585.  
  586.    -      _   Joe Brownlee, Analysts International Corp. @ AT&T Network Systems
  587.   /_\  @ / `  471 E Broad St, Suite 1610, Columbus, Ohio 43215   (614) 860-7461
  588.  /   \ | \_,  E-mail: jbr@cblph.att.com     Who pays attention to what _I_ say?
  589.  "Scotty, we need warp drive in 3 minutes or we're all dead!" --- James T. Kirk
  590. 
  591. 
  592. Path: ucivax!gateway
  593. From: dickie@math.wisc.edu (Garth Dickie)
  594. Subject: Re: Rez (Was Re: Sharing classes)
  595. Message-ID: <9103061412.AA00419@macduffe>
  596. Newsgroups: fa.think-c
  597. Lines: 35
  598. Date: 7 Mar 91 14:35:22 GMT
  599.  
  600. "Martin Minow" <minow@bolt.enet.dec.COM> writes...
  601. >And, if only that resource source was in Rez format so constants were
  602. >entered once only.
  603.  
  604. This one, at least, does have a solution.  SARez/SADerez is in pub/dts/nerdtools
  605. at ftp.apple.com (not apple.com).  There is no documentation, or header files.
  606. However, somewhere (I forget at the moment) the headers for MPW C, Pascal, and
  607. (bingo!) Rez have been placed for ftp.  I think they are on apple.com.  The SA
  608. versions run as standalone applications, and come up into the standard commando
  609. interface.  When you have set up a command line, you can save it as a SARez
  610. document; thereafter, opening the document launches Rez on that command line,
  611. *without* bringing up the commando interface.  It is not quite as convenient
  612. as having the compiler launch for you from a make, but it is quite a bit better
  613. than using RMaker.  Among other things, you can define your own types...
  614.  
  615. There is no documentation on the Rez format available for ftp, that I know of,
  616. but there are several sources of information:
  617.  -- the .r headers from MPW
  618.  -- the .r header from the installer 3.0 documentation is more complicated
  619.  -- run SADerez on large resource files and look at the ouput ;-)
  620.  -- run SADerez on the 'STR#' resources in SARez, and read!  This gives you all
  621.     of the possible error messages and tokens.
  622.  
  623. If you design your headers correctly, you can use them for both C and Rez.
  624. essentially, anything but a #define needs to be bracketed by #ifndef Rez,
  625. #endif directives. (Rez is defined when Rez is running, Derez when Derez is
  626. running, apparently).
  627.  
  628. Among other things, Rez will compile multiple source files into a single
  629. resource file, process `include` (not #include) statements to include actual
  630. resources from other files, and optionally merge compiled resources into the
  631. destination, rather than creating the destination.
  632.  
  633. Sorry if this is all well known,
  634.  -- garth
  635. 
  636. 
  637. Path: ucivax!gateway
  638. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  639. Subject: Sys 6.0.7 SndManager
  640. Message-ID: <9103082046.AA15602@neuromancer>
  641. Newsgroups: fa.think-c
  642. Lines: 21
  643. Date: 8 Mar 91 21:13:47 GMT
  644.  
  645. So now that system 6.0.7 has the new Sound Manager, does anybody have trap
  646. addresses for the new routines, eg. SndRecord() ???
  647.  
  648. I've d/l the interim "Sound Manager/Glue" off the DTS section of AppleLink (it's only in an
  649. AppleLink format so there's little use in posting it).  It has the interim Inside Macintosh
  650. rewrite for SndMgr, but it doesn't include trap addresses.
  651.  
  652. We've been doing some sound work here, and would like to call SndRecord() from ThC.
  653. Anybody seen another SndMgr interface?
  654.  
  655. Thanks -
  656.  
  657. paco
  658. ----
  659. Internet:        paco@neuromancer.sps.mot.com
  660.  
  661. Cyberspace Development
  662. Motorola, Microprocessors
  663. Austin, Texas, USA
  664.  
  665. (c)1991, PXN. Subject to Public Law 99-508.  B*B!
  666. 
  667. 
  668. Path: ucivax!gateway
  669. From: jim@fpr.COM ("James E. O'Dell")
  670. Subject: Floating point stangeness
  671. Message-ID: <9103090248.AA18221@uu.psi.com>
  672. Newsgroups: fa.think-c
  673. Reply-To: "James E. O'Dell" <jim@fpr.COM>
  674. Organization: Fort Pond Research
  675. Lines: 36
  676. Date: 9 Mar 91 02:54:34 GMT
  677.  
  678. I am having trouble with the following short C program...
  679.  
  680. void main()
  681. {
  682.    double fl;
  683.    while (TRUE)
  684. {
  685.      scanf("%lf", &fl);
  686.      printf("%lf\n", fl);
  687.      }
  688. }
  689.  
  690. Here's the problem.
  691.  
  692. Type in 1.0
  693. All is fine I get back 1.0
  694.  
  695. Type in 1.0e-40
  696. All is fine I get back zero
  697.  
  698. Type in 1.0e-4000
  699. All is fine get back zero
  700.  
  701. Now type in 1.0e-50000
  702. I get back INF.
  703.  
  704. This seems like a bug in either SANE or the way THink C is using it.
  705.  
  706. I would like to get back zero for 1.0e-50000 also.
  707. Do I have to make a pre-pass on all of my input to accomplish that?
  708. If not how do I get it?
  709.  
  710. Thanks,
  711. Jim O'Dell
  712.  
  713.  
  714. 
  715. 
  716. Path: ucivax!gateway
  717. From: bose@u.washington.edu (Rob Olsen)
  718. Subject: Mailing list
  719. Message-ID: <9103090844.AA15067@milton.u.washington.edu>
  720. Newsgroups: fa.think-c
  721. Lines: 1
  722. Date: 9 Mar 91 13:22:57 GMT
  723.  
  724. Could you take my name off the mailing list?  Thank you.
  725. 
  726. 
  727. Path: ucivax!gateway
  728. From: russotto@eng.umd.edu ("Matthew T. Russotto")
  729. Subject: Re:  Floating point stangeness
  730. Message-ID: <9103110052.AA07194@bagend.eng.umd.edu>
  731. Newsgroups: fa.think-c
  732. Lines: 3
  733. Date: 13 Mar 91 03:57:49 GMT
  734.  
  735. (-50000) is not in the range of integers, which is probably your limit.  You
  736. might want to change the libraries to use longwords instead, though that
  737. merely extends the limit
  738. 
  739. 
  740. Path: ucivax!gateway
  741. From: soudan@iitmax.iit.edu (Bassel Soudan)
  742. Subject: (none)
  743. Message-ID: <9103112200.AA04041@iitmax.iit.edu>
  744. Newsgroups: fa.think-c
  745. Lines: 57
  746. Date: 13 Mar 91 04:28:22 GMT
  747.  
  748. Hello fellow mail list patrons,
  749.  
  750.     I have a problem that I am trying to solve and I need your help.
  751.  
  752.     The problem has to do with multiple inheritance and goes like this:
  753.  
  754.     I created a CComponent class to model a hardware component. Each
  755. component is made up of several elements (Panes, Buttons, StaticText etc.).
  756. The elements for the components are grouped together in a List called
  757. itsElements. When my component receives a Draw or Move message, I want to
  758. pass that along to all the elements that make up this component. Here is what I
  759. am doing now :
  760.  
  761.     In my CComponent::Draw() method I call
  762.  
  763.     DoForEach->itsElements(DrawElem);
  764.  
  765.     In DrawElem (CObject *obj)     I try to do the following :
  766.  
  767.     obj->Draw();            All the elements that make up the
  768.                     components have a Draw message defined.
  769.  
  770.     When I try to compile this program, I get the famous "Draw is not part
  771. of the struct or union" or something similar to that. I get this because CObject
  772. does not have a Draw method (and it shouldn't).
  773.  
  774.     What I want to do is create a co-parent class for all the objects that
  775. will be elements in my components, so that I can cast obj into that and solve
  776. the problem. The elements that I am using are all subclasses that I derived
  777. from the original classes. (for example I derived a CField class as a sub-class
  778. of CPane).
  779.  
  780.     I created a sub-class of CObject and made all my element classes
  781. sub-classes of that class. The only problem is that my element classes no
  782. longer exhibit the behavior of their original parents. (i.e. my CField which
  783. should be working like a CPane is no longer able to perform any of the things
  784. that a CPane can).
  785.  
  786.     I asked this quetion somewhere else, and somebody suggested that I
  787. create a subclass of CObject (call it Element for now) and then customize
  788. it by pointing to instances of a CPane or a CButtonor or whatever. The only
  789. problem is that my customized instance of CElement will not inherit all the
  790. behavior of the parent class (the one whose instance I am pointing to).
  791.  
  792.     The whole problem is that I need to cast the entries in the itsElements
  793. list to be able to pass them the Draw message that I got. If anyone knows a way
  794. to bypass this casting requirement, that might solve my problem.
  795.  
  796.     I am sorry if this has been long and confusing but this is the only
  797. way I could describe the problem. If you can be of any assistance I would be
  798. eternally gratefull.
  799.  
  800.             Sincerely yours,
  801.  
  802.             Bassel Soudan
  803.  
  804.             soudan@iitmax.iit.edu
  805. 
  806. 
  807. Path: ucivax!gateway
  808. From: Mark.Alldritt@vancouver.osiware.bc.ca (Mark Alldritt)
  809. Subject: TCL app's stop Moire cdev
  810. Message-ID: <910312856*Mark.Alldritt@Vancouver.osiware.bc.ca>
  811. Newsgroups: fa.think-c
  812. Lines: 9
  813. Date: 13 Mar 91 04:42:41 GMT
  814.  
  815. I have noticed that when i'm debugging an application which is based on
  816. the THINK-C Class Library the Moire cdev stops.  By stops I mean that the
  817. clock stops, and the screen saver will not start (even when I put the
  818. mouse in the sleep region).  Has anyone else run into this problem, and
  819. is there a fix I can make?
  820.  
  821. Thanks in advance,
  822.  
  823. -Mark
  824. 
  825. 
  826. Path: ucivax!gateway
  827. From: ehorvath@attmail.COM
  828. Subject: Re: TCL app's stop Moire cdev
  829. Original-From: attmail!ehorvath (Ned Horvath )
  830. Lines: 11
  831. Date: 13 Mar 91 17:30:07 GMT
  832. Phone: +1 908 671 7100
  833. Message-ID: <9103130927.aa28871@ICS.UCI.EDU>
  834. In-Reply-To: your message <internet0720540070> of Wed Mar 13 04:42:41 GMT 1991
  835. >To: internet!ics.uci.edu!think-c
  836. Content-Type: text
  837. Content-Length: 384
  838. Newsgroups: fa.think-c
  839. Message-Version: 2
  840. EMail-Version: 2
  841. UA-Message-ID: <MAC-1.3.2-618034-ehorvath-299>
  842. UA-Content-ID: <MAC-1.3.2-618034-ehorvath-299>
  843. MTS-Message-ID: <ehorvath0721614060>
  844.  
  845. >I have noticed that when i'm debugging an application which is based on
  846. >the THINK-C Class Library the Moire cdev stops...
  847.  
  848. In your CApplication initialization, set gSleepTime to something less than
  849. infinity (the default).
  850.  
  851. Greg Dow considers this a Moire (and Pyro, and...) bug, and I agree with him,
  852. but we have to live in an imperfect world...
  853.  
  854. =Ned Horvath=
  855. ehorvath@attmail.com
  856. 
  857. 
  858. Path: ucivax!gateway
  859. From: ehorvath@attmail.COM
  860. Subject: Recursive drawing
  861. Original-From: attmail!ehorvath (Ned Horvath )
  862. Lines: 39
  863. Date: 13 Mar 91 17:30:43 GMT
  864. Phone: +1 908 671 7100
  865. Message-ID: <9103130928.aa28929@ICS.UCI.EDU>
  866. In-Reply-To: your message <internet0720540080> of Wed Mar 13 04:28:22 GMT 1991
  867. >To: internet!ics.uci.edu!think-c
  868. Content-Type: text
  869. Content-Length: 1402
  870. Newsgroups: fa.think-c
  871. Message-Version: 2
  872. EMail-Version: 2
  873. UA-Message-ID: <MAC-1.3.2-618034-ehorvath-300>
  874. UA-Content-ID: <MAC-1.3.2-618034-ehorvath-300>
  875. MTS-Message-ID: <ehorvath0721614120>
  876.  
  877. soudan@iitmax.iit.edu (Bassel Soudan) writes:
  878.  
  879. >        In my CComponent::Draw() method I call
  880.  
  881. >        DoForEach->itsElements(DrawElem);
  882.  
  883. >        In DrawElem (CObject *obj)      I try to do the following :
  884.  
  885. >        obj->Draw();                    All the elements that make up the
  886.                                         components have a Draw message
  887.                                         defined.
  888.  
  889. >        When I try to compile this program, I get the famous "Draw is not
  890. >part of the struct or union" or something similar to that. I get this because
  891. >CObject does not have a Draw method (and it shouldn't).
  892.  
  893. Correct.  But it does sound as though each type of element could be a subclass
  894. of CPane.  Then your DrawElem should be declared
  895.         DrawElem (CPane *obj)
  896.         ...obj->Draw();
  897.  
  898. You can ensure safety by creating a specialization of CList that only accepts
  899. CPanes as elements, and using that as your list-of-elements class.
  900.  
  901. This fails if there are components that have no visible aspect (a weird,
  902. anti-WYSIWYG notion!), i.e. that don't derive from CPane.  Even there, you can
  903. fix things up in your DrawElem routine:
  904.  
  905.         DrawElem (CObject *obj)
  906.         {
  907.             if (member (obj, CPane)) {      /* if it's drawable...  */
  908.                 ((CPane*)obj)->Draw();      /* ...draw it           */
  909.             }
  910.         }
  911.  
  912. Hope that helps!
  913.  
  914. =Ned Horvath=
  915. ehorvath@attmail.com
  916. 
  917. 
  918. Path: ucivax!gateway
  919. From: minow@ranger.enet.dec.COM (Martin Minow 13-Mar-1991 1438)
  920. Subject: re: recursive drawing
  921. Message-ID: <9103131939.AA24122@enet-gw.pa.dec.com>
  922. Newsgroups: fa.think-c
  923. Lines: 21
  924. Date: 13 Mar 91 19:43:17 GMT
  925.  
  926. soudan@iitmax.iit.edu (Bassel Soudan) writes:
  927. >        In my CComponent::Draw() method I call
  928. >        DoForEach->itsElements(DrawElem);
  929. >        In DrawElem (CObject *obj)      I try to do the following :
  930. >        obj->Draw();                    All the elements that make up the
  931.                                         components have a Draw message
  932.                                         defined.
  933.  
  934. I would approach this problem by something like the following:
  935. 1. create a CDirector sub-class which "owns" both the data and its
  936.    visual representation.
  937. 2. create instance variables with the data
  938. 3. create instance variables with CPane (subclasses) to draw the data in.
  939.  
  940. Now, as long as the CPane's are enclosed by a CPane that is drawn, they
  941. will be drawn automatically.  Each CPane Draw() method would understand
  942. how to draw its data element.  Take a look at CClipboard for one such
  943. example.  Note that the TCL does the DoForEach (itsSubviews) for you.
  944.  
  945. Martin
  946. minow@ranger.enet.dec.com (new address, please update the mail database)
  947. 
  948. 
  949. Path: ucivax!gateway
  950. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  951. Subject: TCL app's stop Moire cdev
  952. Message-ID: <9103132017.AA01170@chaos.cs.brandeis.edu>
  953. In-Reply-To: Mark Alldritt's message of 13 Mar 91 04:42:41 GMT <910312856*Mark.Alldritt@Vancouver.osiware.bc.ca>
  954. Newsgroups: fa.think-c
  955. Lines: 22
  956. Date: 13 Mar 91 20:26:53 GMT
  957.  
  958. Moire, SuperClock, AfterDark, and many other programs work by
  959. "leeching" idle events off of the frontmost application.  Since the
  960. TCL is extremely MuiltFinder polite, it uses a sleep time of MAXLONG.
  961.  
  962. To change the behaviour of the TCL, you should override the
  963. CApplication::Idle() to something like this:
  964.  
  965. void CMyApp::Idle(EventRecord        *macEvent)
  966. {
  967.     inherited::Idle(macEvent);
  968.  
  969.     gSleepTime = Min(gSleepTime, MAX_WAIT_TIME);
  970. }
  971.  
  972. where MAX_WAIT_TIME is set to whatever value seems to work best.  Try
  973. using 200 or so, and work from there.
  974.  
  975.     -phil
  976. ----
  977.    Phil Shapiro                           Technical Support Analyst
  978.    Language Products Group                     Symantec Corporation
  979.         Internet: phils@chaos.cs.brandeis.edu
  980. 
  981. 
  982. Path: ucivax!gateway
  983. From: ECO861771@ecostat.aau.dk
  984. Subject: A problem, and debugger limitations
  985. Message-ID: <A1A0A9E4DD9F007ABC@vms2.uni-c.dk>
  986. Newsgroups: fa.think-c
  987. X-Vms-To: IN::"think-c@ics.uci.edu"
  988. Lines: 78
  989. Date: 20 Mar 91 16:12:41 GMT
  990. X-Envelope-To: think-c@ics.uci.edu
  991.  
  992.  
  993. I have some problems with a program, and I think it is the following
  994. function that causes the problems.
  995.  
  996. The function should remove all resources of type theType from oldResFile,
  997. and replace them with all the resources of the theType from newResFile, which
  998. is read only.
  999.  
  1000. My problem is that it often works, and sometimes I get multiple identical
  1001. resources with the same ID created in the same file, even though there is
  1002. only one copy in newResFile.
  1003.  
  1004. I tried to add a breakpoint at BKPT, and it shows that it is adding just
  1005. the resources as it should, so I suspect that the error is caused by some
  1006. some handle/memory being moved around. If there is anybody who can help
  1007. help me, then I would be glad. It really irritates me that it sometimes
  1008. works.
  1009.  
  1010. BTW: Is there any good method to debug THINK C projects that do a lot of
  1011. work on their own and other resource files ? I really hate the way it works
  1012. now. The program being debugged is type PROJ creator KAHL and not APPL/SIGN.
  1013. And I spoiled my resource file the first time, and I have to copy a clean
  1014. copy each time I want to try running it for debugging again. I am also not
  1015. sure if Get1IndResource works correctly. Does it search the resource file or
  1016. the project file ? I guess we need a standalone debugger to open anapplication
  1017. and the source code. This would surely be better here.
  1018.  
  1019. thanks,
  1020.  
  1021. Povl H. Pedersen
  1022. eco861771@ecostat.aau.dk
  1023.  
  1024. --- code follows ---
  1025.  
  1026. MyMoveResources( theType, oldResFile, newResFile )
  1027. ResType theType;
  1028. int    oldResFile, newResFile;
  1029. {
  1030.     register int            i, NumTypes;
  1031.     Handle            resTmp;
  1032.     ResType            myType;
  1033.     int                Itype;
  1034.     Str255            myStr;
  1035.  
  1036.     /* Remove all old ICON from file */ /* This Works */
  1037.     UseResFile( oldResFile );
  1038.     NumTypes = Count1Resources( theType );
  1039.  
  1040.     for (i=1; i<=NumTypes; i++)
  1041.     {
  1042.         resTmp = Get1IndResource(theType, i);
  1043.         RmveResource( resTmp );
  1044.         DisposHandle( resTmp );
  1045.     }
  1046.  
  1047.         /* The next part does NOT ALWAYS work, it sometimes creates too
  1048.            many identical copies of one resource. */
  1049.  
  1050.     UseResFile( newResFile ); /* read from new */
  1051.     NumTypes = Count1Resources( theType );
  1052.  
  1053.     for (i=1; i<=NumTypes; i++)
  1054.     {
  1055.         UseResFile( newResFile ); /* read from new */
  1056.         resTmp =  Get1IndResource(theType, i);
  1057.         HLock( resTmp );
  1058.         GetResInfo( resTmp, &Itype, &myType, myStr );
  1059.          DetachResource( resTmp ); /* do not use */
  1060.         UseResFile( oldResFile ); /* write to old */
  1061. BKPT
  1062.         AddResource( resTmp, myType, Itype, myStr );
  1063.         UpdateResFile( oldResFile );
  1064.         HUnlock( resTmp );
  1065.         ReleaseResource( resTmp );/*delete in map and free*/
  1066.  
  1067.     }
  1068.  
  1069. }
  1070. 
  1071. 
  1072. Path: ucivax!gateway
  1073. From: siegel@world.std.COM (Rich Siegel)
  1074. Subject: Re:  A problem, and debugger limitations
  1075. Message-ID: <9103210027.AA11558@world.std.com>
  1076. Newsgroups: fa.think-c
  1077. Lines: 7
  1078. Date: 21 Mar 91 00:30:53 GMT
  1079.  
  1080.  
  1081. When your program runs, the .Rsrc file is at the top of the map
  1082. chain, and is CurResFile(), so all of the Get1xxxResource calls will
  1083. behave correctly with your program, unless you're trying to muck with
  1084. your own application's code resources.
  1085.  
  1086. R.
  1087. 
  1088. 
  1089. Path: ucivax!gateway
  1090. From: bootsie!olson@ICS.UCI.EDU ("Eric K. Olson")
  1091. Subject: Re: A problem, and debugger limitations
  1092. Message-ID: <9103210039.AA08273@bootsie.UUCP>
  1093. In-Reply-To: vax.ftp.com!ECO861771@ecostat.aau.dk's message of Wed 20-Mar-91  4:12pm.
  1094. X-Mailer: Mail User's Shell (6.4 2/14/89)
  1095. Newsgroups: fa.think-c
  1096. Reply-To: olson@endor.harvard.edu
  1097. Lines: 110
  1098. Date: 21 Mar 91 00:41:24 GMT
  1099.  
  1100. In a message of Mar 20,  4:12pm, it is written:
  1101. > [...]
  1102. > The function should remove all resources of type theType from oldResFile,
  1103. > and replace them with all the resources of the theType from newResFile, which
  1104. > is read only.
  1105. >
  1106. > My problem is that it often works, and sometimes I get multiple identical
  1107. > resources with the same ID created in the same file, even though there is
  1108. > only one copy in newResFile.
  1109. >
  1110. > BTW: Is there any good method to debug THINK C projects that do a lot of
  1111. > work on their own and other resource files ? I really hate the way it works
  1112. > now. The program being debugged is type PROJ creator KAHL and not APPL/SIGN.
  1113.  
  1114. The project file is of this type.  You shouldn't be manipulating
  1115. resources in the project file, however.  You should modify resources in
  1116. your project's .rsrc file (this file can be of any type or creator,
  1117. usually a ResEdit document).  This file is CurResFile() when starting up
  1118. under the editor.  The application will be CurResFile() when starting
  1119. up, after being built.  Just save this refNum in a global and you will
  1120. always have the application's (or the .rsrc file's) resource file refNum.
  1121.  
  1122. > And I spoiled my resource file the first time, and I have to copy a clean
  1123. > copy each time I want to try running it for debugging again.
  1124.  
  1125. This can still happen.  Having multiple resources with idential types and
  1126. IDs is a serious offender when it comes to spoiling resource files.
  1127.  
  1128. > I am also not
  1129. > sure if Get1IndResource works correctly. Does it search the resource file or
  1130. > the project file ?
  1131.  
  1132. It searches only the _current_ CurResFile.  I like to save and restore
  1133. the CurResFile around Resource Manager Calls.
  1134.  
  1135. The Macintosh Print Manager sometimes sets the CurResFile to the most
  1136. recently opened file, on exit from its routines (this is often correct,
  1137. but not always).  This can really cause trouble if you assume that
  1138. UseResFile(appRefNum) is permanent, and you have another (more recently
  1139. opened) resource file.
  1140.  
  1141. I suspect you are getting double resources because the remove is
  1142. failing, not the add.  Check its return code with ResError().  This can
  1143. be caused by the resProtected bit being set, or if the HomeResFile() of
  1144. the resource is not the CurResFile().
  1145.  
  1146. It _might_ also occur if the resource is currently loaded into memory
  1147. and HNoPurged().  I can't remember if I found a bug in Get1Resource()
  1148. that returns any already loaded resource with the same type and ID (from
  1149. any file) instead of the resource in the CurResFile().  Perhaps you can
  1150. check this out.  If that bug does exist, the RmveResource() would fail
  1151. because the resource's HomeResFile() would be the CurResFile.
  1152.  
  1153. It's not very easy dealing with multiple resource files.
  1154.  
  1155. > MyMoveResources( theType, oldResFile, newResFile )
  1156. > ResType theType;
  1157. > int    oldResFile, newResFile;
  1158. > {
  1159. >     register int            i, NumTypes;
  1160. >     Handle            resTmp;
  1161. >     ResType            myType;
  1162. >     int                Itype;
  1163. >     Str255            myStr;
  1164. >
  1165. >     /* Remove all old ICON from file */ /* This Works */
  1166. >     UseResFile( oldResFile );
  1167. >     NumTypes = Count1Resources( theType );
  1168. >
  1169. >     for (i=1; i<=NumTypes; i++)
  1170. >     {
  1171. >         resTmp = Get1IndResource(theType, i);
  1172. >         RmveResource( resTmp );
  1173.  
  1174. I think the above call fails when the resource's "double up".
  1175.  
  1176. >         DisposHandle( resTmp );
  1177. >     }
  1178. >
  1179. >         /* The next part does NOT ALWAYS work, it sometimes creates too
  1180. >            many identical copies of one resource. */
  1181. >
  1182. >     UseResFile( newResFile ); /* read from new */
  1183. >     NumTypes = Count1Resources( theType );
  1184. >
  1185. >     for (i=1; i<=NumTypes; i++)
  1186. >     {
  1187. >         UseResFile( newResFile ); /* read from new */
  1188. >         resTmp =  Get1IndResource(theType, i);
  1189. >         HLock( resTmp );
  1190. >         GetResInfo( resTmp, &Itype, &myType, myStr );
  1191. >          DetachResource( resTmp ); /* do not use */
  1192. >         UseResFile( oldResFile ); /* write to old */
  1193. > BKPT
  1194. >         AddResource( resTmp, myType, Itype, myStr );
  1195. >         UpdateResFile( oldResFile );
  1196. >         HUnlock( resTmp );
  1197. >         ReleaseResource( resTmp );/*delete in map and free*/
  1198. >
  1199. >     }
  1200. >
  1201. > }
  1202. >
  1203.  
  1204.  
  1205. --
  1206. Eric K. Olson, Editor, Prepare()      NOTE:     olson@bootsie.uucp doesn't work
  1207. Lexington Software Design             Internet: olson@endor.harvard.edu
  1208. 72A Lowell St., Lexington, MA  02173  Uucp:     harvard!endor!olson
  1209. (617) 863-9624                        Bitnet:   OLSON@HARVARD
  1210. 
  1211. 
  1212. Path: ucivax!gateway
  1213. From: mkelly@cs.uoregon.edu
  1214. Subject: _SwapMMUMode doesn't work
  1215. Message-ID: <9103210252.AA25842@obelix.cs.uoregon.edu.cs.uoregon.edu>
  1216. Newsgroups: fa.think-c
  1217. Lines: 28
  1218. Date: 21 Mar 91 02:55:22 GMT
  1219.  
  1220.  
  1221. Help!  When I step through the following code:
  1222.  
  1223.     short        mode, mode2;
  1224.  
  1225.     mode = true32b;
  1226.     mode2 = GetMMUMode();
  1227.     SwapMMUMode( &mode );
  1228.     mode2 = GetMMUMode();
  1229.  
  1230. mode2 == 0 before the call to SwapMMUMode (and mode == 1); after the call,
  1231. mode is still == 1, and after the 2nd call to GetMMUMode, mode2 is still == 0.
  1232.  
  1233. What is going on here?
  1234.  
  1235. (I have the Profiler, 68020, and MacHeaders options set, and the MF Attrs ==
  1236. 0080 : 32-bit compatible).
  1237.  
  1238. Thanks,
  1239.  
  1240. Mike.
  1241. _____________________________________________________________________________
  1242. Michael A. Kelly                                   America Online: Michael792
  1243. mkelly@cs.uoregon.edu                                  Compu$erve: 73567,1651
  1244. _____________________________________________________________________________
  1245. "I know not with what weapons World War III will be fought, but World War
  1246.  IV will be fought with sticks and stones."
  1247.         - Albert Einstein
  1248. 
  1249. 
  1250. Newsgroups: fa.think-c
  1251. Path: ucivax!jhummel
  1252. From: jhummel@ics.uci.edu (Joseph Edward Hummel)
  1253. Subject: Help with malloc -- fails for large n?
  1254. Message-ID: <27E88FE3.7394@ics.uci.edu>
  1255. Sender: jhummel@ics.uci.edu (Joseph Edward Hummel)
  1256. Organization: UC Irvine Department of ICS
  1257. Distribution: usa
  1258. Date: Thu, 21 Mar 1991 10:50:11 GMT
  1259. Lines: 17
  1260.  
  1261. Maybe someone out there can explain the following.  I'm running Think C
  1262. version 4.0.2, and if I do the following, it works:
  1263.   
  1264.          p = malloc(16000 * sizeof(int));
  1265.   
  1266. But if I change the 16000 to 17000, it fails -- p is set to NULL after 
  1267. the call.  17000 * sizeof(int) isn't that big, what's the deal?  Does malloc
  1268. behave strangely under certain circumstances?  My program is one big main, 
  1269. could that be it?
  1270.   
  1271. Thanks in advance.
  1272.   
  1273.   - joe
  1274. -- 
  1275. Joe Hummel
  1276. ICS Graduate Student, UC Irvine
  1277. Internet: jhummel@ics.uci.edu
  1278. 
  1279. 
  1280. Path: ucivax!gateway
  1281. From: dak@sq.COM
  1282. Subject: Re: Help with malloc -- fails for large n?
  1283. Message-ID: <m0jJS8L-00014PC@sq.sq.com>
  1284. In-reply-to: Your message of "Thu, 21 Mar 91 10:50:11 GMT."
  1285.              <27E88FE3.7394@ics.uci.edu>
  1286. Newsgroups: fa.think-c
  1287. Lines: 31
  1288. Date: 21 Mar 91 16:05:17 GMT
  1289.  
  1290.  
  1291. > Maybe someone out there can explain the following.  I'm running Think C
  1292. > version 4.0.2, and if I do the following, it works:
  1293. >
  1294. >          p = malloc(16000 * sizeof(int));
  1295. >
  1296. > But if I change the 16000 to 17000, it fails -- p is set to NULL after
  1297. > the call.  17000 * sizeof(int) isn't that big, what's the deal?  Does malloc
  1298. > behave strangely under certain circumstances?  My program is one big main,
  1299. > could that be it?
  1300.  
  1301. One oddity in the ThinkC compiler is that sizeof() is an int, not a size_t.
  1302. (User's manual, 7.4.8)
  1303.  
  1304. So you are getting integer arithmetic for your computation...which overflows
  1305. to a negative number (16000 * 2 == 32000, 17000 * 2 == 34000, which is greater
  1306. than 32767, and therefore won't fit in an int).
  1307.  
  1308. Try 17000L * sizeof(int), that should work.
  1309.  
  1310. By the way, how do other folks solve the "sizeof isn't a size_t" oddity?
  1311. I've been casting the result to size_t in code that I've been porting, but...
  1312. I was hoping for a better way.
  1313.  
  1314. Regards,
  1315. Dak
  1316. --
  1317. David A. 'Dak' Keldsen of SoftQuad, Inc. email: dak@sq.com  phone: 416-963-8337
  1318. "...Then anyone who leaves behind him a written manual, and likewise
  1319. anyone who receives it, in the belief that such writing will be clear
  1320. and certain, must be exceedingly simple-minded..."   -- Plato, _Phaedrus_
  1321. 
  1322. 
  1323. Path: ucivax!gateway
  1324. From: bin@primate.wisc.edu (Brain in Neutral)
  1325. Subject: Re: A problem, and debugger limitations
  1326. Message-ID: <9103211603.AA06060@rhesus.primate.wisc.edu>
  1327. Newsgroups: fa.think-c
  1328. Lines: 5
  1329. Date: 21 Mar 91 16:05:29 GMT
  1330.  
  1331. One of the problems with removing resources is that it's best to remove
  1332. them in a loop that counts DOWN, not up.
  1333.  
  1334. Paul DuBois
  1335. dubois@primate.wisc.edu
  1336. 
  1337. 
  1338. Path: ucivax!gateway
  1339. From: srauseo@128.38.16.7
  1340. Subject: Getting a PixMap
  1341. Message-ID: <34.srauseo@128.38.16.7>
  1342. Newsgroups: fa.think-c
  1343. Reply-To: srauseo@nswc-wo.navy.MIL
  1344. Lines: 42
  1345. Date: 21 Mar 91 16:32:30 GMT
  1346.  
  1347.   I have two video cards, one of them a RasterOps ColorBoard 364, which in
  1348. addition to being a 24-bit color card, also will grab a video frame to the card.
  1349. I want to be able to get to the PixMap of that screen, but I am having a bit of
  1350. trouble.
  1351.  
  1352.   So far, I have been able to select the correct card and get the handle to the
  1353. GDevice, and thus the handle to the PixMap associated with that device.
  1354. Here is where my troubles begin.
  1355.  
  1356. First, I have the Inside Macintosh series, but not the documentation for 32-bit
  1357. Quickdraw.  The Inside Mac does not describe any more than one pixelType for a
  1358. PixMap (that is Chunky, pixelType=1).  The pixelType on this device is 16.  What
  1359. does that correspond to?
  1360.  
  1361. Second, I have a question concerning 32-bit addresses.  The baseAddress of the
  1362. PixMap for the 364 board is shown by the THINK-C debugger to be 0x000000, even
  1363. though as a long int it is 0xFA000000.  (The same for the main screen--the address
  1364. is listed as 0x000000, but coerced to be a long, it shows up as 0xF9000000.)  I
  1365. assume that this is just a sign that THINK-C is using 24 bit addressing.  I am also
  1366. then assuming that 32-bit Qucikdraw will be smart enough to use 32-bit
  1367. addressing when I do a CopyBits.
  1368.  
  1369. My last questions concerns the color version of CopyBits.  Do the PixMaps used
  1370. in CopyBits have to be the portPixMap of some cGrafPort?  I would like to be able to
  1371. copy from the PixMap associated with the screen to some PixMap created in main
  1372. memory without having to create any intermediate CGrafPort's, but I don't see how
  1373. CopyBits will know it is a PixMapHandle and not a BitMap without the high bits set in
  1374. the portVersion variable.
  1375.  
  1376. What I would really like to do is get around all of this foolishness and
  1377. directly access the bytes in the PixMap data on the card, but the 32-bit addressing
  1378. seems to be getting in the way.  Any hints or ideas?
  1379.  
  1380. I am using THINK-C 4.0.1
  1381.  
  1382. ****************************************************
  1383. *                  Steven Rauseo (R44)             *
  1384. *         srauseo@nswc-wo.navy.mil [26.1.0.102]    *
  1385. *              Naval Surface Warfare Center        *
  1386. *              Nonliear Dynamics Group             *
  1387. *               Phone (301) 394-4325               *
  1388. ****************************************************
  1389. 
  1390. 
  1391. Path: ucivax!gateway
  1392. From: bruce@logic.dsg.ti.COM ("Bruce Florman (BFLM")
  1393. Subject: Re: Help with malloc -- fails for large n?
  1394. Message-ID: <9103211854.AA16054@logic.dsg.ti.com>
  1395. In-Reply-To: <m0jJS8L-00014PC@sq.sq.com>; from "dak@sq.COM" at Mar 21, 91 4:05 pm
  1396. X-Mailer: ELM [version 2.3 PL3]
  1397. Newsgroups: fa.think-c
  1398. Lines: 11
  1399. Date: 21 Mar 91 20:05:21 GMT
  1400.  
  1401. > By the way, how do other folks solve the "sizeof isn't a size_t" oddity?
  1402. > I've been casting the result to size_t in code that I've been porting, but...
  1403. > I was hoping for a better way.
  1404.  
  1405. How does everyone feel about this:
  1406.  
  1407. #define SIZEOF(T) ((size_t)sizeof(T))
  1408.  
  1409. It's a bit ugly, but it is portable.
  1410.  
  1411. --Bruce Florman
  1412. 
  1413. 
  1414. Path: ucivax!gateway
  1415. From: bruce@logic.dsg.ti.COM ("Bruce Florman (BFLM")
  1416. Subject: Re: Help with malloc -- fails for large n?
  1417. Message-ID: <9103211814.AA15369@logic.dsg.ti.com>
  1418. In-Reply-To: <27E88FE3.7394@ics.uci.edu>; from "Joseph Edward Hummel" at Mar 21, 91 10:50 am
  1419. X-Mailer: ELM [version 2.3 PL3]
  1420. Newsgroups: fa.think-c
  1421. Lines: 27
  1422. Date: 21 Mar 91 20:10:42 GMT
  1423.  
  1424. >
  1425. > Maybe someone out there can explain the following.  I'm running Think C
  1426. > version 4.0.2, and if I do the following, it works:
  1427. >
  1428. >          p = malloc(16000 * sizeof(int));
  1429. >
  1430. > But if I change the 16000 to 17000, it fails -- p is set to NULL after
  1431. > the call.  17000 * sizeof(int) isn't that big, what's the deal?  Does malloc
  1432. > behave strangely under certain circumstances?  My program is one big main,
  1433. > could that be it?
  1434.  
  1435. Try changing it to 17000L * sizeof(int) and I'll bet it will work.  Since
  1436. THINK C's sizeof operator returns an int rather than a size_t (this is a
  1437. mis-feature IMHO) and since 17000 is in the range of int for THINK C, the
  1438. compiler evaluates this as an int expression.  However, 17000 * sizeof(int)
  1439. is 34000 (0x84d0) in THINK C, which is beyond the range of int (the high
  1440. bit is set, so the quantity looks negative).  I assume that you've included
  1441. stdlib.h, so the compiler knows that malloc takes a 4 byte argument (size_t),
  1442. so it sign extends 0x84d0 to 0xffff84d0, which as an unsigned quantity is a
  1443. little over 4 gigabytes.  Since malloc can't allocate that much memory on any
  1444. current Macs, it returns NULL.
  1445.  
  1446. By changing the expression to 17000L * sizeof(int), or alternatively
  1447. 17000 * (size_t)sizeof(int), you will cause the compiler to recognize that
  1448. the expression result requires 4 bytes.
  1449.  
  1450. --Bruce Florman
  1451. 
  1452. 
  1453. Newsgroups: fa.think-c
  1454. Path: ucivax!jhummel
  1455. From: jhummel@ics.uci.edu (Joseph Edward Hummel)
  1456. Subject: Help with malloc...
  1457. Message-ID: <27E915B4.12063@ics.uci.edu>
  1458. Sender: jhummel@ics.uci.edu (Joseph Edward Hummel)
  1459. Organization: UC Irvine Department of ICS
  1460. Distribution: usa
  1461. Date: Thu, 21 Mar 1991 20:21:08 GMT
  1462. Lines: 29
  1463.  
  1464. Wow, thanks for all the responses to my plea for help with malloc.  The
  1465. problem was this:
  1466.   
  1467.         p = malloc(16000 * sizeof(int));
  1468.   
  1469. worked, but 
  1470.  
  1471.         p = malloc(17000 * sizeof(int));
  1472.   
  1473. didn't.  The problem turns out to be that since ints are 2 bytes in Think C,
  1474. the 17000 x 2 becomes negative (since 34000 sets the sign bit in a 2-byte int),
  1475. and then this value is cast into a negative long which is then passed to 
  1476. malloc.  Malloc then promptly chokes.  
  1477.   
  1478. The solution is to cast either of the two operands into a long: e.g.
  1479.   
  1480.         p = malloc(17000L * sizeof(int));
  1481.   
  1482. I think what I'll do is create a sizeof macro for use with malloc that 
  1483. casts its result into a long (or more correctly, to a value of type
  1484. size_t).
  1485.  
  1486. Thanks to all who replied!
  1487.   
  1488.   - joe
  1489. -- 
  1490. Joe Hummel
  1491. ICS Graduate Student, UC Irvine
  1492. Internet: jhummel@ics.uci.edu
  1493. 
  1494. 
  1495. Path: ucivax!gateway
  1496. From: ephraim@think.COM
  1497. Subject: Re: Help with malloc -- fails for large n?
  1498. Message-ID: <9103211422.AA06845@leander.think.com>
  1499. In-Reply-To: Your message of "Thu, 21 Mar 91 10:50:11 GMT."
  1500.              <27E88FE3.7394@ics.uci.edu>
  1501. Newsgroups: fa.think-c
  1502. Lines: 17
  1503. Date: 21 Mar 91 20:27:12 GMT
  1504.  
  1505.  
  1506.    From: Joseph Edward Hummel <jhummel@ICS.UCI.EDU>
  1507.    Date: Thu, 21 Mar 1991 10:50:11 GMT
  1508.  
  1509.    Maybe someone out there can explain the following.  I'm running Think
  1510.    C version 4.0.2, and if I do the following, it works:
  1511.  
  1512.          p = malloc(16000 * sizeof(int));
  1513.  
  1514.    But if I change the 16000 to 17000, it fails -- p is set to NULL after
  1515.    the call.  17000 * sizeof(int) isn't that big, what's the deal?
  1516.  
  1517. The deal is that 17000*sizeof(int) isn't representable as an int, so
  1518. it gets truncated.  Try (size_t)17000*sizeof(int).  Since size_t is
  1519. long in Think C, you'll get better results.  The brain damage here is
  1520. that typeof(sizeof()) should be size_t, not int.
  1521.  
  1522. 
  1523. 
  1524. Path: ucivax!gateway
  1525. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  1526. Subject: THINK C header & lib for HyperCard 2.0 XCMDs
  1527. Message-ID: <9103212126.AA29935@chaos.cs.brandeis.edu>
  1528. Newsgroups: fa.think-c
  1529. Lines: 252
  1530. Date: 21 Mar 91 21:29:09 GMT
  1531.  
  1532. Here's the official conversion of the HyperCard 2.0 header file and
  1533. library for THINK C.  We've tested it for a while and haven't found
  1534. any problems.  This release fixes some problems that are present in
  1535. the copy presently in your archives, so you will probably want to
  1536. replace your copy with this one.
  1537.  
  1538.     -phil
  1539. ----
  1540.    Phil Shapiro                           Technical Support Analyst
  1541.    Language Products Group                     Symantec Corporation
  1542.         Internet: phils@chaos.cs.brandeis.edu
  1543.  
  1544. ---------------- think-c-hc-20.cpt.hqx ----------------
  1545. (This file must be converted with BinHex 4.0)
  1546.  
  1547. :'94)58j,)%-J5%-b,M!J5'9KC'9bFbjMF(3!8%&$9%033e3"!*!$,#i!N!6Nr`%
  1548. "3TJ!!#ZeD3!!UUUQ!!B!N!P!Q3!!Q'"SHAH*Q)U*"jQD"hCfH'F+KhPkKfLAHTJ
  1549. +#!4P9'CPYeC8D999GhHD#`!+N!!!N#B*)!!#-d499PCfPhGQGRGhKjL*KjQ(Q)U
  1550. B!+N+N!#U#TS*U8!M49@3!fCfChGfD'GiQ*GiL(L)Q)QCLSL+#3S*#3#UUSS!N!#
  1551. !UU!!UU#C#DQBN!#UQR#3!*UDN!#S#T!!#3QJS!#U#U$kmRr[hqr($)!2&SmpmVH
  1552. l0ZTi0T!!Ic5ee@9Ae6XKVUVP$A1f"NHD0Y-1l0dmed)f!+jmh9G#Ub'EJ3LB3c6
  1553. hqGY@cEI$kU24$LqllZ+(CjlSfAbS!jE[RE%Na`3Kb9e`-UZKE+k9[K+P9$DGS%J
  1554. QEj@kid5#ZYP$9'k9-!bQk)'+Se`S89XU60pAR$Nhl`f1DHlIJ#A,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m(2UAQ&HRS$rQR*!!Mf0apMElJ"([l@K1'Lj"qqIGlJbhr'1
  1778. G@4Mjjde(39kQ)#N+D6H80SC$p6Z0VZM'ZdlJ()#0GZEr!%am)XrMRq`GKZi1qqj
  1779. J`4J'$jd5*DI2!PI`3k1MU),2M!-&@C',2+!C2393@HDAH3&H1"B*JKQSZJ'$-,)
  1780. CYpi!c%6X2@AK!-'$C"Kj3$,05'16L3N,1)G3Ak!)Xm"3a9GImB$"Lm)aer4!B,U
  1781. +'f`3'F+4`0rLll*KPJ#3!d%#I9i!!J!,5(P`CA*B3feN,QJ"!*!$#&4&@&4,38K
  1782. -Sma3eU3+QQ`"!&#F*FB!"!#3"LME!*!'#r!,5(P`CA*B6'PL,VN"!!!,q&"56dT
  1783. ,38K-SmY9$+2-80d"!+RTA$-!!J!!B`i!N!BI[3#3"&!i!!!:
  1784. 
  1785. 
  1786. Path: ucivax!gateway
  1787. From: mkelly@cs.uoregon.edu
  1788. Subject: Re: Getting a PixMap
  1789. Message-ID: <9103212305.AA27770@obelix.cs.uoregon.edu.cs.uoregon.edu>
  1790. Newsgroups: fa.think-c
  1791. Lines: 57
  1792. Date: 21 Mar 91 23:08:59 GMT
  1793.  
  1794.  
  1795. >Quickdraw.  The Inside Mac does not describe any more than one pixelType for a
  1796. >PixMap (that is Chunky, pixelType=1).  The pixelType on this device is 16.  Wh
  1797. >at
  1798. >does that correspond to?
  1799. >
  1800.  
  1801. According to 'Designing Cards and Drivers for the Macintosh Family' page 130,
  1802. the pixelType for a direct device is ChunkyDirect == 16.
  1803.  
  1804. >Second, I have a question concerning 32-bit addresses.  The baseAddress of the
  1805. >PixMap for the 364 board is shown by the THINK-C debugger to be 0x000000, even
  1806. >though as a long int it is 0xFA000000.  (The same for the main screen--the add
  1807. >ress
  1808. >is listed as 0x000000, but coerced to be a long, it shows up as 0xF9000000.)
  1809. >I
  1810. >assume that this is just a sign that THINK-C is using 24 bit addressing.  I am
  1811. > also
  1812. >then assuming that 32-bit Qucikdraw will be smart enough to use 32-bit
  1813. >addressing when I do a CopyBits.
  1814. >
  1815.  
  1816. I am having exactly the same problems with 32bqd installed, Think C 4.0.2.
  1817. As I said before, if you get any useful replies to the question of how to
  1818. write directly to the PixMap, please forward them to me.
  1819.  
  1820. >My last questions concerns the color version of CopyBits.  Do the PixMaps used
  1821. >in CopyBits have to be the portPixMap of some cGrafPort?  I would like to be a
  1822. >ble to
  1823. >copy from the PixMap associated with the screen to some PixMap created in main
  1824. >memory without having to create any intermediate CGrafPort's, but I don't see
  1825. >how
  1826. >CopyBits will know it is a PixMapHandle and not a BitMap without the high bits
  1827. > set in
  1828. >the portVersion variable.
  1829. >
  1830.  
  1831. It works fine for me - just remember to lock the PixMap before you try to
  1832. CopyBits from or draw to it.  CopyBits copies from a BitMap to a BitMap -
  1833. whether the BitMaps are associated with GrafPorts or not is irrelevant.  The
  1834. same goes for PixMaps.
  1835.  
  1836. >What I would really like to do is get around all of this foolishness and
  1837. >directly access the bytes in the PixMap data on the card, but the 32-bit addre
  1838. >ssing
  1839. >seems to be getting in the way.  Any hints or ideas?
  1840. >
  1841.  
  1842. Me too, but I can't get SwapMMUMode to work.
  1843.  
  1844.  
  1845. Mike.
  1846. _____________________________________________________________________________
  1847. Michael A. Kelly                                   America Online: Michael792
  1848. mkelly@cs.uoregon.edu                                  Compu$erve: 73567,1651
  1849. _____________________________________________________________________________
  1850. "The proof is left as an exercise for the reader."
  1851. 
  1852. 
  1853. Path: ucivax!gateway
  1854. From: mkelly@cs.uoregon.edu
  1855. Subject: Re: _SwapMMUMode doesn't work
  1856. Message-ID: <9103220047.AA28433@obelix.cs.uoregon.edu.cs.uoregon.edu>
  1857. Newsgroups: fa.think-c
  1858. Lines: 65
  1859. Date: 22 Mar 91 00:52:51 GMT
  1860.  
  1861.  
  1862. This is from Juri Munkki:
  1863.  
  1864. I found out what is wrong with the whole thing. I did some work with TMON
  1865. and I came up with the following information:
  1866.  
  1867. Think C has incorrect glue for GetMMUMode. Actually the glue code is quite
  1868. much ok, but the call parameters are defined wrong. The glue code expects
  1869. a var parameter just as is defined in IM-V-592, but the compiler doesn't
  1870. allow this.
  1871.  
  1872. The glue code for SwapMMUMode wants a char var parameter.
  1873.  
  1874. So, you can't use GetMMUMode to get the mode, but then again you do not
  1875. need to, since it is given to you by SwapMMUMode. Here's the shortest
  1876. application that works and at the same time documents that it works:
  1877.  
  1878. void    main()
  1879. {
  1880.         char    mode1,mode2;
  1881.  
  1882.         mode1=true32b;
  1883.         SwapMMUMode(&mode1);
  1884.         mode2=mode1;
  1885.         SwapMMUMode(&mode2);
  1886.         Debugger();
  1887. }
  1888.  
  1889. At the Debugger() line, mode1==0 and mode2==1. This is as it should be.
  1890.  
  1891. Happy hacking. I'm going to bed.
  1892.  
  1893.    ____________________________________________________________________________
  1894.   / Juri Munkki     /  Helsinki University of Technology   /  Wind  / Project /
  1895.  / jmunkki@hut.fi  /  Computing Center Macintosh Support  /  Surf  /  STORM  /
  1896.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1897.  
  1898. P.S. You might want to report this to the Think C list. I'm too tired.
  1899.  
  1900.  
  1901.  
  1902.  
  1903. I managed to get my code working before I received the above message from
  1904. Juri.  Here is what I've got:
  1905.  
  1906.     short        mode;
  1907.  
  1908.     if ( QD32Installed() ) {
  1909.         SwapMMUMode( &mode );
  1910.         Debugger();
  1911.     }
  1912.  
  1913. When MacsBug is invoked with 'Debugger()', it says I'm in 32-bit mode.  Yay!
  1914.  
  1915. BTW, if the above code is run with the Think Debugger running in the background
  1916. it will crash and burn, which is what was happening to me before.
  1917.  
  1918.  
  1919. Mike.
  1920. _____________________________________________________________________________
  1921. Michael A. Kelly                                   America Online: Michael792
  1922. mkelly@cs.uoregon.edu                                  Compu$erve: 73567,1651
  1923. _____________________________________________________________________________
  1924. "That's not a lie, it's a terminological inexactitude."
  1925.         - Alexander Haig
  1926. 
  1927. 
  1928. Path: ucivax!gateway
  1929. From: mkelly@cs.uoregon.edu
  1930. Subject: Re: _SwapMMUMode doesn't work
  1931. Message-ID: <9103220052.AA28502@obelix.cs.uoregon.edu.cs.uoregon.edu>
  1932. Newsgroups: fa.think-c
  1933. Lines: 19
  1934. Date: 22 Mar 91 00:53:19 GMT
  1935.  
  1936.  
  1937. A correction to my previous posting - my code should read:
  1938.  
  1939.         short           mode = 0x0101;
  1940.  
  1941.         if ( QD32Installed() ) {
  1942.                 SwapMMUMode( &mode );
  1943.                 Debugger();
  1944.         }
  1945.  
  1946.  
  1947.  
  1948. Mike.
  1949. _____________________________________________________________________________
  1950. Michael A. Kelly                                   America Online: Michael792
  1951. mkelly@cs.uoregon.edu                                  Compu$erve: 73567,1651
  1952. _____________________________________________________________________________
  1953. "Television validates existence."
  1954.         - Calvin
  1955. 
  1956. 
  1957. Path: ucivax!gateway
  1958. From: tl17+@andrew.cmu.edu (Ta-Chun Lin)
  1959. Subject: Traffic watch
  1960. Message-ID: <0bwWyOu00WB64Cq2tl@andrew.cmu.edu>
  1961. Newsgroups: fa.think-c
  1962. Lines: 10
  1963. Date: 28 Mar 91 18:04:41 GMT
  1964.  
  1965. Hi Everydoby:
  1966.   Did anybody use "Traffic Watch" before? It is a counter to check every
  1967. packet send out and receive to every node in a network system. It turns
  1968. AppleTalk off and uses Printer port instead. I do not have idea how it can
  1969. be implemented. I use dumpcode to disassembly "Traffic Watch" but I did not
  1970. see any useful Toolbox Routines Call. Does anybody have any idea about
  1971. how it is done? Any suggestion is appreciated. Thanks in advance.
  1972.  
  1973. Shiem-MIn Chen
  1974. tl17@andrew.cmu.edu
  1975. 
  1976. 
  1977. Path: ucivax!gateway
  1978. From: petrus@alex.stacken.kth.se (Lars Petrus)
  1979. Subject: New Creator
  1980. Message-ID: <9103290942.AAalex.stacken.kth.se11716@alex.stacken.kth.se>
  1981. Newsgroups: fa.think-c
  1982. Lines: 41
  1983. Date: 29 Mar 91 09:49:24 GMT
  1984.  
  1985.    I need to change the creator and type of my documents. After a full day of
  1986. trying to understand the crazy world of the File Manager I thought I had
  1987. grasped the nescessary concepts and came up with this simple solution (as
  1988. you see, I work in TCL):
  1989.  
  1990.  
  1991. Boolean CLogoCorrectorDoc::DoSave(void)
  1992.  
  1993. {
  1994.     OSErr        theError;
  1995.     FInfo        *info;
  1996.  
  1997.     theError = itsFile->Open(fsRdWrPerm);
  1998.  
  1999.     <save the document>
  2000.  
  2001. /*    theError=HGetFInfo(itsFile->volNum, itsFile->dirID, itsFile->name, info);
  2002.  *    info->fdType='THIS';
  2003.  *    info->fdCreator='THAT';
  2004.  *    theError=HSetFInfo(itsFile->volNum, itsFile->dirID, itsFile->name, info);
  2005.  */
  2006.     /* wd=macSFReply->vRefNum; set in OpenFile() */
  2007.     theError=GetFInfo(itsFile->name, wd, info);
  2008.     info->fdType='THIS';
  2009.     info->fdCreator='THAT';
  2010.     theError=SetFInfo(itsFile->name, wd, info);
  2011.  
  2012.     <do some cleaning up>
  2013. }
  2014.  
  2015.    However, inside GetFInfo() (or in HGetFInfo() if I use the equivalent
  2016. commented code) it just dies in a Bus Error. I'm absolutely clueless! If no
  2017. one can help me I guess I'll just have to delete the file and recreate it...
  2018.  
  2019.  
  2020.  
  2021. "Madness is the first sign of dandruff" |   Email:   petrus@alex.stacken.kth.se
  2022.    - Dr Winston O'Boogie                |   Reality: Lars Petrus, Solna, Sweden
  2023.  
  2024.  
  2025.  
  2026. 
  2027. 
  2028. Path: ucivax!gateway
  2029. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  2030. Subject: New Creator
  2031. Message-ID: <9103291419.AA02137@chaos.cs.brandeis.edu>
  2032. In-Reply-To: Lars Petrus's message of 29 Mar 91 09:49:24 GMT <9103290942.AAalex.stacken.kth.se11716@alex.stacken.kth.se>
  2033. Newsgroups: fa.think-c
  2034. Lines: 26
  2035. Date: 29 Mar 91 14:21:27 GMT
  2036.  
  2037.    Boolean CLogoCorrectorDoc::DoSave(void)
  2038.    {
  2039.        OSErr        theError;
  2040.        FInfo        *info;
  2041.  
  2042.        theError=GetFInfo(itsFile->name, wd, info);
  2043.    }
  2044.  
  2045.       However, inside GetFInfo() (or in HGetFInfo() if I use the equivalent
  2046.    commented code) it just dies in a Bus Error.
  2047.  
  2048. You must allocate space for the FInfo record before you use it.  The
  2049. easiest way to accomplish this is to use stack alloation, ie, to
  2050. declare your record locally.  Try:
  2051.  
  2052. {
  2053.     FInfo info;
  2054.  
  2055.     theError = GetFInfo(itsFile->name, wd, &info);
  2056. }
  2057.  
  2058.     -phil
  2059. ----
  2060.    Phil Shapiro                           Technical Support Analyst
  2061.    Language Products Group                     Symantec Corporation
  2062.         Internet: phils@chaos.cs.brandeis.edu
  2063. 
  2064. 
  2065. Path: ucivax!gateway
  2066. From: minow@ranger.enet.dec.COM (Martin Minow 31-Mar-1991 1031)
  2067. Subject: Buglet in TBUtilities.c PositionDialog()
  2068. Message-ID: <9103311542.AA23240@enet-gw.pa.dec.com>
  2069. Newsgroups: fa.think-c
  2070. Lines: 28
  2071. Date: 31 Mar 91 15:45:23 GMT
  2072.  
  2073. There's a minor bug in the TCL TBUtilities.c PositionDialog that doesn't
  2074. correctly position tall dialogs (270 pixels) on small (Mac/SE) screens.
  2075. Make the following changes (this is being retyped, so fix any typos, too :-)
  2076.  
  2077.     ...
  2078.     left = (screenBits.bounds.right - (theRect->right - theRect->left)) / 2;
  2079. #if 0 /* Remove the following */
  2080.     top = (screenBits.bounds.bottom - (theRect->bottom - theRect->top)) / 3;
  2081.     top = Max(top, GetMBarHeight() + 1);
  2082. #else /* Insert the following */
  2083.     top = (
  2084.         screenBits.bounds.bottom
  2085.         - GetMBarHeight()
  2086.         - 1
  2087.         - (theRect->bottom - theRect->top)
  2088.     ) / 3;
  2089.     if (top < 0)
  2090.         top = 0;
  2091.     top += (GetMBarHeight() + 1);
  2092. #endif
  2093.     theRect->right += left - theRect->left;
  2094.     ...
  2095.  
  2096. Note: the same error (with the same fix) is probably in FindDlogPosition
  2097. in the same file.
  2098.  
  2099. Martin
  2100. minow@ranger.enet.dec.com
  2101. 
  2102.